// base
import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image } from '@tarojs/components'
// less
import './index.less'
import If from '../../../../components/page-components/if'

class AddResume extends Component {
  componentWillMount () {
    // onLoad
  }

  componentDidMount () {
    // onready
  }

  componentDidShow () {
    // onshow
  }

  componentDidHide () {
    // onhide
  }

  componentWillUnmount () {
    // onUnload
  }

  onTap = () => {
    this.props.onTap()
  }

  render () {
    const { height, replay, name } = this.props
    return (
      <View className="wrap-add-resume">
        <If
          visible={!replay}
          renderElse={
            <View className="AddResume_replay_id96501" onClick={this.onTap}>
              <Image
                className="iconimg"
                src="https://imagesize.hrwork.com/sp/files/da8795ff-522b-4c3a-ac2d-08b15db85716.png"
              />
              <View className="addname">{this.props.replayName}</View>
            </View>
          }
        >
          <View
            className="AddResume_id96501"
            style={{ height: height || '94rpx' }}
            onClick={this.onTap}
          >
            <Image
              className="iconimg"
              src="https://imagesize.hrwork.com/sp/files/da8795ff-522b-4c3a-ac2d-08b15db85716.png"
            />
            <View className="addname">{name}</View>
          </View>
        </If>
      </View>
    )
  }
}

export default AddResume
